//
//  CoreDataManager.h
//  CoreDataTool
//
//  Created by dllo on 15/10/30.
//  Copyright © 2015年 fan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

@interface CoreDataManager : NSObject


//数据模型管理类
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;

//数据模型(表)
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;

//数据库连接类
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;

//数据库操作方法(增, 删, 改, 查)
- (void)saveContext;

//数据库本地路径(沙盒路径)
- (NSURL *)applicationDocumentsDirectory;


//获取manager对象单例方法
+(CoreDataManager *)shareManager;

/**判断专辑*/
-(BOOL)isExist:(NSString *)className
     SearchKey:(NSString *)key
  SearchString:(NSString *)string;

/**删除指定专辑*/
-(BOOL)deleteAlbum:(NSString *)albumId;

/**判断播放历史是否存在*/
-(BOOL)playHistoryString:(NSString *)string;

/**删除电台历史表中所有元素*/
-(BOOL)deleteAllHistory;

/**删除播放历史表中所有元素*/
-(BOOL)deleteAllPlayHistory;

/**判断电台历史是否存在*/
-(BOOL)radioHistoryIsExist:(NSString *)radioId;



@end
